<?php 

/**
 * CoreController
 * @author lk
 */
class GeneralController extends My_Controller {

	
	/** Acl Role */
	public function aclroleformAction(){
		echo $this->_helper->form(new AclRole());
	}
	public function aclrolegridAction(){
		$this->_helper->grid(new AclRole());
	}
	public function aclroledelAction(){
		echo $this->_helper->delete(new AclRole());
	}
	
	/** User*/
	public function userformAction(){
		echo $this->_helper->form(new User());
	}
	public function usergridAction(){
		$this->_helper->grid(new User());
	}
	public function userdelAction(){
		echo $this->_helper->delete(new User());
	}
	
	/** Author*/
	public function authorformAction(){
				
		if($this->operation()=='save'){
			$file = Util_File::handleUpload('author_image');
			$res = $this->_helper->form(new Author(),false);
			
			$author_id = ($this->operation('author_id')== 'insert')?
				$res['data'] : $this->getRequest()->getParam('author_id'); 
			
			Util_File::finishHim($file, 'author_image',$author_id);
			echo json_encode($res);
		} else {
			echo $this->_helper->form(new Author());
		}		
	}
	public function authorgridAction(){
		$this->_helper->grid(new Author());
	}
	public function authordelAction(){
		echo $this->_helper->delete(new Author());
	}
	
	/** Denomination*/
	public function denominationformAction(){
		echo $this->_helper->form(new Denomination());
	}
	public function denominationgridAction(){
		$this->_helper->grid(new Denomination());
	}
	public function denominationdelAction(){
		echo $this->_helper->delete(new Denomination());
	}
	
	/** Language */
	public function languageformAction(){
		echo $this->_helper->form(new Language());
	}
	public function languagegridAction(){
		$this->_helper->grid(new Language());
	}
	public function languagedelAction(){
		echo $this->_helper->delete(new Language());
	}
	
	
	/** Tag */
	public function tagformAction(){
		echo $this->_helper->form(new Tag());
	}
	public function taggridAction(){
		$this->_helper->grid(new Tag());
	}
	public function tagdelAction(){
		echo $this->_helper->delete(new Tag());
	}
	
	
	
}
